package com.guoheng.hazard.sys.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类功能描述:　TODO
 *
 * @author fbl
 * @date 2019-12-13 14:26
 */
@RestController
@Validated
@Api(value = "redis测试")
public class RedisTest {
    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @GetMapping("/test")
    public void test(String[] args) {
        // 保存字符串
        stringRedisTemplate.opsForValue().set("aaa", "111");
    }
}